package demo.practice.competition;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class P5792 {

    public static void main(String[] args) {
//        double a =Math.pow(250, 0.5);
//        System.out.println(a);

        P5792 p5792 = new P5792();
        int i = p5792.countTriples(5);
        System.out.println(i);
    }

    public int countTriples(int n) {
        int max = (int) Math.pow(n, 0.5);
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                int sq = (int) Math.pow(i * i + j * j, 0.5);
                if (sq<=n&&sq * sq == i * i + j * j ){
                    sum++;
                    log.info("{} {} {}",i,j,sq);
                }

            }
        }


        return sum;
    }
}
